/*
 * Created by JFormDesigner on Mon Jun 17 18:01:49 EDT 2013
 */

package CreateNewItem;

import CreateNewItem.WIN.AddNewPartLI;

import java.awt.*;
import java.awt.event.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.swing.*;
import javax.swing.border.*;

/**
 * @author Jason Chi
 */
public class CreateNewItem extends JFrame {
    ItemVariables ni = new ItemVariables();
    public CreateNewItem() {

        initComponents();

        //Get today's Date for REMARK
        DateFormat df= new SimpleDateFormat("MM/dd/yyyy");
        Date today = Calendar.getInstance().getTime();
        String tDate = df.format(today);





    }

    private void okButtonMouseClicked(MouseEvent e) {
        // TODO add your code here
    }

    private void okButtonActionPerformed(ActionEvent e) {
        //assign fields to variables
        int site=0;  //site 0=LI, site 1=BL
        int wareHouse=0;  //site 0=LI, site 1=BL
        getFieldToVariable();
//        System.out.println("capa :"+sCAPA);
        SQLEXEC sqlinsert = new SQLEXEC();
        sqlinsert.setSite(site);
        sqlinsert.setWareHouse(wareHouse);

        //Assign unused variable to value before passing to tblnu
        ni.COST = "0";
        ni.R_COST = "0";
        ni.QOH = "0";
        ni.CONTROL=null;



        //check if PART# exists, If not, it will create the item. Otherwise it'll issue a warming about duplicate item.
        if (sqlinsert.checkDupItem("select [part#] from tblinventory where [part#]='"+ni.ITEM_NO+"'"))
            JOptionPane.showMessageDialog(null,"Deplicated DNK Part# Found! \nPlease verify the Part# or use another number to continue.");
        else {
                while(site<=1 && wareHouse<=1){


                //Clear TBLNU
                sqlinsert.DelTblNU();

                //Add item to tblnu table
                    //Assign unused variable to value before passing to tblnu
                    ni.COST = "0";
                    ni.R_COST = "0";
                    ni.QOH = "0";
                    ni.CONTROL=null;
                sqlinsert.CreateNewItemNU(ni.ITEM_NO,ni.PART_NO,ni.BRAND,ni.MODEL,ni.CATALOG,ni.DESCRIPT,ni.R_COST,ni.COST,ni.RETAIL,ni.QOH,ni.CONTROL,ni.LI_WARE,ni.POSITION,ni.NEW_DES,ni.NEW_MOD,ni.YR_L,ni.YR_H,ni.REMARK);
                //with variables, process SQL to add new item (WIN)
                sqlinsert.AddNewPart();
                int catNum = Integer.parseInt(ni.CATALOG);
    //            System.out.println("!!\n"+ni.CATALOG);
    //            System.out.println(catNum);
                switch (catNum){
                    case 1:
                        //test null jason 8-2-13
//                        if (ni.TYG_TW_NO==""){
//                            ni.TYG_TW_NO=null;
//
//                        }
    //                  //create item to tblbcn (6 CATS)
                        sqlinsert.CreateNewItemBC(ni.ITEM_NO, ni.PART_NO,ni.SUPP,ni.DESCRIPT,ni.CAPA,ni.PARTLINK,ni.POSITION,ni.REMARK
                                ,ni.TYG_TW_NO,ni.TYG_TW_PRC,ni.TYG_TW_PKG,ni.TYG_TW_CUFT,ni.TYG_TW_REMARK
                                ,ni.GD_NO,ni.GD_PRC,ni.GD_PKG,ni.GD_CUFT,ni.GD_REMARK
                                ,ni.TYG_TX_NO,ni.TYG_TX_PRC,ni.TYG_TX_PKG,ni.TYG_TX_REMARK
                                ,ni.PROTEC_NO,ni.PROTEC_PRC,ni.PROTEC_PKG,ni.PROTEC_CUFT, ni.PROTEC_REMARK);
                        //creates position
                        sqlinsert.updTblnWithInv(ni.CATALOG,ni.ITEM_NO);
                        break;
                    case 2:
    //
                        sqlinsert.CreateNewItemHF(ni.ITEM_NO, ni.PART_NO,ni.SUPP,ni.DESCRIPT,ni.CAPA,ni.PARTLINK,ni.POSITION,ni.REMARK
                                ,ni.TYG_TW_NO,ni.TYG_TW_PRC,ni.TYG_TW_PKG,ni.TYG_TW_CUFT,ni.TYG_TW_REMARK
                                ,ni.GD_NO,ni.GD_PRC,ni.GD_PKG,ni.GD_CUFT,ni.GD_REMARK
                                ,ni.TYG_TX_NO,ni.TYG_TX_PRC,ni.TYG_TX_PKG,ni.TYG_TX_REMARK
                                ,ni.PROTEC_NO,ni.PROTEC_PRC,ni.PROTEC_PKG,ni.PROTEC_CUFT, ni.PROTEC_REMARK);
                        sqlinsert.updTblnWithInv(ni.CATALOG,ni.ITEM_NO);
                        break;
                    case 3:
    //
                        sqlinsert.CreateNewItemLT(ni.ITEM_NO, ni.PART_NO,ni.SUPP,ni.DESCRIPT,ni.CAPA,ni.PARTLINK,ni.POSITION,ni.REMARK
    //                            ,ni.TYG_TW_NO,ni.TYG_TW_PRC,ni.TYG_TW_PKG,ni.TYG_TW_CUFT,ni.TYG_TW_REMARK
                                ,ni.GN_NO,ni.GN_PRC,ni.GN_PKG,ni.GN_REMARK
                                ,ni.DEPO_NO,ni.DEPO_PRC,ni.DEPO_PKG,ni.DEPO_REMARK
    //                            ,ni.KV_NO,ni.KV_PRC,ni.KV_PKG,ni.KV_REMARK
    //                            ,ni.PROTEC_NO,ni.PROTEC_PRC,ni.PROTEC_PKG,ni.PROTEC_CUFT, ni.PROTEC_REMARK
                                );
                        sqlinsert.updTblnWithInv(ni.CATALOG,ni.ITEM_NO);
                        break;
                    case 4:
    //
                        sqlinsert.CreateNewItemCL(ni.ITEM_NO, ni.PART_NO,ni.SUPP,ni.DESCRIPT,ni.CAPA,ni.PARTLINK,ni.POSITION,ni.REMARK
                                ,ni.TYG_TW_NO,ni.TYG_TW_PRC,ni.TYG_TW_PKG,ni.TYG_TW_CUFT,ni.TYG_TW_REMARK
                                ,ni.GD_NO,ni.GD_PRC,ni.GD_PKG,ni.GD_CUFT,ni.GD_REMARK
                                ,ni.TYG_TX_NO,ni.TYG_TX_PRC,ni.TYG_TX_PKG,ni.TYG_TX_REMARK
                                ,ni.PROTEC_NO,ni.PROTEC_PRC,ni.PROTEC_PKG,ni.PROTEC_CUFT, ni.PROTEC_REMARK
                                ,ni.GN_NO,ni.GN_PRC,ni.GN_PKG,ni.GN_CUFT,ni.GN_REMARK
                                ,ni.DEPO_NO,ni.DEPO_PRC,ni.DEPO_PKG,ni.DEPO_CUFT,ni.DEPO_REMARK
                                ,ni.KV_NO,ni.KV_PRC,ni.KV_PKG,ni.KV_CUFT,ni.KV_REMARK);

                        sqlinsert.updTblnWithInv(ni.CATALOG,ni.ITEM_NO);
                        break;
                    case 5:
    //
                        sqlinsert.CreateNewItemMR(ni.ITEM_NO, ni.PART_NO,ni.SUPP,ni.DESCRIPT,ni.CAPA,ni.PARTLINK,ni.POSITION,ni.REMARK
                                ,ni.TYG_TW_NO,ni.TYG_TW_PRC,ni.TYG_TW_PKG,ni.TYG_TW_CUFT,ni.TYG_TW_REMARK
                                ,ni.GD_NO,ni.GD_PRC,ni.GD_PKG,ni.GD_CUFT,ni.GD_REMARK
                                ,ni.TYG_TX_NO,ni.TYG_TX_PRC,ni.TYG_TX_PKG,ni.TYG_TX_REMARK
                                ,ni.PROTEC_NO,ni.PROTEC_PRC,ni.PROTEC_PKG,ni.PROTEC_CUFT, ni.PROTEC_REMARK
                                ,ni.GN_NO,ni.GN_PRC,ni.GN_PKG,ni.GN_CUFT,ni.GN_REMARK
                                ,ni.DEPO_NO,ni.DEPO_PRC,ni.DEPO_PKG,ni.DEPO_CUFT,ni.DEPO_REMARK
                                ,ni.KV_NO,ni.KV_PRC,ni.KV_PKG,ni.KV_CUFT,ni.KV_REMARK);
                        sqlinsert.updTblnWithInv(ni.CATALOG,ni.ITEM_NO);
                        break;
                    case 6:
    //
                        sqlinsert.CreateNewItemOT(ni.ITEM_NO, ni.PART_NO,ni.SUPP,ni.DESCRIPT,ni.CAPA,ni.PARTLINK,ni.POSITION,ni.REMARK
                                ,ni.TYG_TW_NO,ni.TYG_TW_PRC,ni.TYG_TW_PKG,ni.TYG_TW_CUFT,ni.TYG_TW_REMARK
                                ,ni.GD_NO,ni.GD_PRC,ni.GD_PKG,ni.GD_CUFT,ni.GD_REMARK
                                ,ni.TYG_TX_NO,ni.TYG_TX_PRC,ni.TYG_TX_PKG,ni.TYG_TX_REMARK
                                ,ni.PROTEC_NO,ni.PROTEC_PRC,ni.PROTEC_PKG,ni.PROTEC_CUFT, ni.PROTEC_REMARK);
                        sqlinsert.updTblnWithInv(ni.CATALOG,ni.ITEM_NO);
                        break;
                }

                //check if model key exists
                if (sqlinsert.checkDupMod("SELECT * from mod_key where [mod_one] = '"+ni.mod_one +"' and  [m_key] = '"+ni.m_key+"'")){
//                    System.out.println("Duplicate Entry found in MOD_KEY, Entry will not be created!");
                    //don't create
                }else {
    //            System.out.println("run  if not found");
                    //Create mod_key
                    sqlinsert.modelKey(ni.mod_one,ni.m_key);

                };
//                JOptionPane.showMessageDialog(null,"Create Item "+ site +"Completed!");
                site++;
                wareHouse++;
                sqlinsert.setSite(site);
                sqlinsert.setWareHouse(wareHouse);

            }
            JOptionPane.showMessageDialog(null,"Create Item Completed!");
        }



    }

    private void cancelButtonActionPerformed(ActionEvent e) {
//        SQLEXEC sqlexec = new SQLEXEC();
//        sqlexec.checkDupItem(sITEM_NO.getText());

//        sqlinsert.AddNewPart();  //create duplicates
        super.setVisible(true);
        this.setVisible(false);
        System.exit(0);
    }

    private void sNEW_MODActionPerformed(ActionEvent e) {
        // TODO add your code here
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner Evaluation license - jason Chi
        dialogPane = new JPanel();
        Vendor = new JPanel();
        label24 = new JLabel();
        label25 = new JLabel();
        label26 = new JLabel();
        label27 = new JLabel();
        label28 = new JLabel();
        label29 = new JLabel();
        tygtw = new JLabel();
        sTYG_TW_NO = new JTextField();
        sTYG_TW_PRC = new JTextField();
        sTYG_TW_PKG = new JTextField();
        sTYG_TW_CUFT = new JTextField();
        sTYG_TW_REMARK = new JTextField();
        twgtx = new JLabel();
        sTYG_TX_NO = new JTextField();
        sTYG_TX_PRC = new JTextField();
        sTYG_TX_PKG = new JTextField();
        sTYG_TX_CUFT = new JTextField();
        sTYG_TX_REMARK = new JTextField();
        genera = new JLabel();
        sGN_NO = new JTextField();
        sGN_PRC = new JTextField();
        sGN_PKG = new JTextField();
        sGN_CUFT = new JTextField();
        sGN_REMARK = new JTextField();
        depo = new JLabel();
        sDEPO_NO = new JTextField();
        sDEPO_PRC = new JTextField();
        sDEPO_PKG = new JTextField();
        sDEPO_CUFT = new JTextField();
        sDEPO_REMARK = new JTextField();
        ap = new JLabel();
        sGD_NO = new JTextField();
        sGD_PRC = new JTextField();
        sGD_PKG = new JTextField();
        sGD_CUFT = new JTextField();
        sGD_REMARK = new JTextField();
        ycc = new JLabel();
        sPROTEC_NO = new JTextField();
        sPROTEC_PRC = new JTextField();
        sPROTEC_PKG = new JTextField();
        sPROTEC_CUFT = new JTextField();
        sPROTEC_REMARK = new JTextField();
        koolview = new JLabel();
        sKV_NO = new JTextField();
        sKV_PRC = new JTextField();
        sKV_PKG = new JTextField();
        sKV_CUFT = new JTextField();
        sKV_REMARK = new JTextField();
        Basic = new JPanel();
        label1 = new JLabel();
        sITEM_NO = new JTextField();
        label8 = new JLabel();
        sPART_NO = new JTextField();
        label14 = new JLabel();
        sPARTSLINK = new JTextField();
        label6 = new JLabel();
        sYR_L = new JTextField();
        label7 = new JLabel();
        sYR_H = new JTextField();
        label9 = new JLabel();
        sBRAND = new JTextField();
        label10 = new JLabel();
        sNEW_MOD = new JTextField();
        label11 = new JLabel();
        sNEW_DES = new JTextField();
        label15 = new JLabel();
        sPOSITION = new JTextField();
        label2 = new JLabel();
        sCATELOG = new JTextField();
        label12 = new JLabel();
        sWH_SALE = new JTextField();
        label13 = new JLabel();
        sRETAIL = new JTextField();
        label16 = new JLabel();
        sCAPA = new JTextField();
        label3 = new JLabel();
        sREMARK = new JTextField();
        sSERIALIZED = new JCheckBox();
        sDISCONTINUED = new JCheckBox();
        sTAXABLE = new JCheckBox();
        sINTERNETITEM = new JCheckBox();
        label4 = new JLabel();
        sMODEL = new JTextField();
        label5 = new JLabel();
        sDESCRIPT = new JTextField();
        label17 = new JLabel();
        buttonBar = new JPanel();
        okButton = new JButton();
        cancelButton = new JButton();

        //======== this ========
        setTitle("Create New Item");
        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== dialogPane ========
        {
            dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));

            // JFormDesigner evaluation mark
            dialogPane.setBorder(new javax.swing.border.CompoundBorder(
                new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                    "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
                    javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
                    java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});

            dialogPane.setLayout(new BorderLayout());

            //======== Vendor ========
            {
                Vendor.setBorder(new TitledBorder("VENDOR INFORMATION:"));
                Vendor.setBackground(new Color(0, 153, 153));
                Vendor.setLayout(new GridBagLayout());
                ((GridBagLayout)Vendor.getLayout()).columnWidths = new int[] {0, 108, 53, 43, 6, 415, 0};
                ((GridBagLayout)Vendor.getLayout()).rowHeights = new int[] {9, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                ((GridBagLayout)Vendor.getLayout()).columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};
                ((GridBagLayout)Vendor.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};

                //---- label24 ----
                label24.setText("VENDOR");
                Vendor.add(label24, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label25 ----
                label25.setText("PART#");
                Vendor.add(label25, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label26 ----
                label26.setText("PRICE");
                Vendor.add(label26, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label27 ----
                label27.setText("PKG");
                Vendor.add(label27, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label28 ----
                label28.setText("CUBE");
                Vendor.add(label28, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label29 ----
                label29.setText("MEMO");
                Vendor.add(label29, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- tygtw ----
                tygtw.setText("TYG_TAIWAN");
                tygtw.setFont(tygtw.getFont().deriveFont(tygtw.getFont().getStyle() | Font.ITALIC));
                Vendor.add(tygtw, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TW_NO ----
                sTYG_TW_NO.setText(" ");
                Vendor.add(sTYG_TW_NO, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TW_PRC ----
                sTYG_TW_PRC.setText("0.00");
                Vendor.add(sTYG_TW_PRC, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TW_PKG ----
                sTYG_TW_PKG.setText("0");
                Vendor.add(sTYG_TW_PKG, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TW_CUFT ----
                sTYG_TW_CUFT.setText("0");
                Vendor.add(sTYG_TW_CUFT, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TW_REMARK ----
                sTYG_TW_REMARK.setText(" ");
                Vendor.add(sTYG_TW_REMARK, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- twgtx ----
                twgtx.setText("TYG_TEXAS");
                twgtx.setFont(twgtx.getFont().deriveFont(twgtx.getFont().getStyle() | Font.ITALIC));
                Vendor.add(twgtx, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TX_NO ----
                sTYG_TX_NO.setText(" ");
                Vendor.add(sTYG_TX_NO, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TX_PRC ----
                sTYG_TX_PRC.setText("0.00");
                Vendor.add(sTYG_TX_PRC, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TX_PKG ----
                sTYG_TX_PKG.setText("0");
                Vendor.add(sTYG_TX_PKG, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TX_CUFT ----
                sTYG_TX_CUFT.setText("0");
                Vendor.add(sTYG_TX_CUFT, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTYG_TX_REMARK ----
                sTYG_TX_REMARK.setText(" ");
                Vendor.add(sTYG_TX_REMARK, new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- genera ----
                genera.setText("GENERA (TYC)");
                genera.setFont(genera.getFont().deriveFont(genera.getFont().getStyle() | Font.ITALIC));
                Vendor.add(genera, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGN_NO ----
                sGN_NO.setText(" ");
                Vendor.add(sGN_NO, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGN_PRC ----
                sGN_PRC.setText("0.00");
                Vendor.add(sGN_PRC, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGN_PKG ----
                sGN_PKG.setText("0");
                Vendor.add(sGN_PKG, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGN_CUFT ----
                sGN_CUFT.setText("0");
                Vendor.add(sGN_CUFT, new GridBagConstraints(4, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGN_REMARK ----
                sGN_REMARK.setText(" ");
                Vendor.add(sGN_REMARK, new GridBagConstraints(5, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- depo ----
                depo.setText("MAXZONE (DEPO)");
                depo.setFont(depo.getFont().deriveFont(depo.getFont().getStyle() | Font.ITALIC));
                Vendor.add(depo, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDEPO_NO ----
                sDEPO_NO.setText(" ");
                Vendor.add(sDEPO_NO, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDEPO_PRC ----
                sDEPO_PRC.setText("0.00");
                Vendor.add(sDEPO_PRC, new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDEPO_PKG ----
                sDEPO_PKG.setText("0");
                Vendor.add(sDEPO_PKG, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDEPO_CUFT ----
                sDEPO_CUFT.setText("0");
                Vendor.add(sDEPO_CUFT, new GridBagConstraints(4, 5, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDEPO_REMARK ----
                sDEPO_REMARK.setText(" ");
                Vendor.add(sDEPO_REMARK, new GridBagConstraints(5, 5, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- ap ----
                ap.setText("AP ( SHOW AS GD)");
                ap.setFont(ap.getFont().deriveFont(ap.getFont().getStyle() | Font.ITALIC));
                Vendor.add(ap, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGD_NO ----
                sGD_NO.setText(" ");
                Vendor.add(sGD_NO, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGD_PRC ----
                sGD_PRC.setText("0.00");
                Vendor.add(sGD_PRC, new GridBagConstraints(2, 6, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGD_PKG ----
                sGD_PKG.setText("0");
                Vendor.add(sGD_PKG, new GridBagConstraints(3, 6, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGD_CUFT ----
                sGD_CUFT.setText("0");
                Vendor.add(sGD_CUFT, new GridBagConstraints(4, 6, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sGD_REMARK ----
                sGD_REMARK.setText(" ");
                Vendor.add(sGD_REMARK, new GridBagConstraints(5, 6, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- ycc ----
                ycc.setText("YCC (SHOW AS PROT)");
                ycc.setFont(ycc.getFont().deriveFont(ycc.getFont().getStyle() | Font.ITALIC));
                Vendor.add(ycc, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPROTEC_NO ----
                sPROTEC_NO.setText(" ");
                Vendor.add(sPROTEC_NO, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPROTEC_PRC ----
                sPROTEC_PRC.setText("0.00");
                Vendor.add(sPROTEC_PRC, new GridBagConstraints(2, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPROTEC_PKG ----
                sPROTEC_PKG.setText("0");
                Vendor.add(sPROTEC_PKG, new GridBagConstraints(3, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPROTEC_CUFT ----
                sPROTEC_CUFT.setText("0");
                Vendor.add(sPROTEC_CUFT, new GridBagConstraints(4, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPROTEC_REMARK ----
                sPROTEC_REMARK.setText(" ");
                Vendor.add(sPROTEC_REMARK, new GridBagConstraints(5, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 0), 0, 0));

                //---- koolview ----
                koolview.setText("KOOL VIEW ");
                koolview.setFont(koolview.getFont().deriveFont(koolview.getFont().getStyle() | Font.ITALIC));
                Vendor.add(koolview, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 0, 5), 0, 0));

                //---- sKV_NO ----
                sKV_NO.setText(" ");
                Vendor.add(sKV_NO, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 5), 0, 0));

                //---- sKV_PRC ----
                sKV_PRC.setText("0.00");
                Vendor.add(sKV_PRC, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 5), 0, 0));

                //---- sKV_PKG ----
                sKV_PKG.setText("0");
                Vendor.add(sKV_PKG, new GridBagConstraints(3, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 5), 0, 0));

                //---- sKV_CUFT ----
                sKV_CUFT.setText("0");
                Vendor.add(sKV_CUFT, new GridBagConstraints(4, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 5), 0, 0));

                //---- sKV_REMARK ----
                sKV_REMARK.setText(" ");
                Vendor.add(sKV_REMARK, new GridBagConstraints(5, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 0), 0, 0));
            }
            dialogPane.add(Vendor, BorderLayout.CENTER);

            //======== Basic ========
            {
                Basic.setBorder(new TitledBorder("BASIC INFO. ALL FIELDS ARE REQUIRED!"));
                Basic.setBackground(new Color(0, 204, 102));
                Basic.setLayout(new GridBagLayout());
                ((GridBagLayout)Basic.getLayout()).columnWidths = new int[] {106, 89, 10, 0, 98, 0, 48, 0, 76, 41, 43, 40, 35, 34, 0, 0};
                ((GridBagLayout)Basic.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
                ((GridBagLayout)Basic.getLayout()).columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};
                ((GridBagLayout)Basic.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};

                //---- label1 ----
                label1.setText("DNK PART#");
                Basic.add(label1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sITEM_NO ----
                sITEM_NO.setText("DNK1");
                Basic.add(sITEM_NO, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label8 ----
                label8.setText("OEM#");
                Basic.add(label8, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPART_NO ----
                sPART_NO.setText("OEM");
                Basic.add(sPART_NO, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label14 ----
                label14.setText("PARTLINK#");
                Basic.add(label14, new GridBagConstraints(5, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sPARTSLINK ----
                sPARTSLINK.setText("PL");
                Basic.add(sPARTSLINK, new GridBagConstraints(6, 0, 2, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label6 ----
                label6.setText("BEGIN YR");
                Basic.add(label6, new GridBagConstraints(8, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sYR_L ----
                sYR_L.setText("2013");
                sYR_L.setBackground(Color.white);
                Basic.add(sYR_L, new GridBagConstraints(9, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label7 ----
                label7.setText("END YR");
                Basic.add(label7, new GridBagConstraints(10, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sYR_H ----
                sYR_H.setText("2014");
                Basic.add(sYR_H, new GridBagConstraints(11, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label9 ----
                label9.setText("BRAND");
                Basic.add(label9, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));
                Basic.add(sBRAND, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label10 ----
                label10.setText("MODEL");
                Basic.add(label10, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sNEW_MOD ----
                sNEW_MOD.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        sNEW_MODActionPerformed(e);
                    }
                });
                Basic.add(sNEW_MOD, new GridBagConstraints(4, 1, 8, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label11 ----
                label11.setText("DESC");
                Basic.add(label11, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));
                Basic.add(sNEW_DES, new GridBagConstraints(4, 2, 8, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label15 ----
                label15.setText("POSITION");
                Basic.add(label15, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));
                Basic.add(sPOSITION, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label2 ----
                label2.setText("CAT");
                Basic.add(label2, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sCATELOG ----
                sCATELOG.setText("1");
                sCATELOG.setToolTipText("1 = BC, \n 2 = HF, \n 3 = LT,\n 4 = CL,\n 5 = MR,\n 6 = OT,");
                Basic.add(sCATELOG, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label12 ----
                label12.setText("WHOLESALE $");
                label12.setVisible(false);
                Basic.add(label12, new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sWH_SALE ----
                sWH_SALE.setText("0.00");
                sWH_SALE.setVisible(false);
                Basic.add(sWH_SALE, new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label13 ----
                label13.setText("RETAIL $");
                Basic.add(label13, new GridBagConstraints(9, 3, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sRETAIL ----
                sRETAIL.setText("0.00");
                Basic.add(sRETAIL, new GridBagConstraints(10, 3, 2, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label16 ----
                label16.setText("CAPA (Y/N)");
                Basic.add(label16, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sCAPA ----
                sCAPA.setText("N");
                Basic.add(sCAPA, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label3 ----
                label3.setText("MEMO");
                Basic.add(label3, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sREMARK ----
                sREMARK.setText("MEMO");
                Basic.add(sREMARK, new GridBagConstraints(4, 4, 8, 3, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sSERIALIZED ----
                sSERIALIZED.setText("SERIALIZED");
                sSERIALIZED.setEnabled(false);
                sSERIALIZED.setVisible(false);
                Basic.add(sSERIALIZED, new GridBagConstraints(4, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDISCONTINUED ----
                sDISCONTINUED.setText("DISCONTINUED");
                sDISCONTINUED.setEnabled(false);
                sDISCONTINUED.setVisible(false);
                Basic.add(sDISCONTINUED, new GridBagConstraints(5, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sTAXABLE ----
                sTAXABLE.setText("TAXABLE");
                sTAXABLE.setEnabled(false);
                sTAXABLE.setVisible(false);
                Basic.add(sTAXABLE, new GridBagConstraints(6, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sINTERNETITEM ----
                sINTERNETITEM.setText("INTERNET ITEM");
                sINTERNETITEM.setEnabled(false);
                sINTERNETITEM.setVisible(false);
                Basic.add(sINTERNETITEM, new GridBagConstraints(8, 7, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label4 ----
                label4.setText("MODEL");
                label4.setEnabled(false);
                label4.setVisible(false);
                Basic.add(label4, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sMODEL ----
                sMODEL.setEnabled(false);
                sMODEL.setVisible(false);
                Basic.add(sMODEL, new GridBagConstraints(1, 8, 4, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label5 ----
                label5.setText("DESCRIPTION");
                label5.setEnabled(false);
                label5.setVisible(false);
                Basic.add(label5, new GridBagConstraints(5, 8, 1, 1, 0.0, 0.0,
                    GridBagConstraints.EAST, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- sDESCRIPT ----
                sDESCRIPT.setEnabled(false);
                sDESCRIPT.setVisible(false);
                Basic.add(sDESCRIPT, new GridBagConstraints(6, 8, 6, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 5, 5), 0, 0));

                //---- label17 ----
                label17.setText("TESTING PHASE");
                label17.setForeground(new Color(204, 0, 0));
                label17.setPreferredSize(new Dimension(160, 32));
                Basic.add(label17, new GridBagConstraints(5, 9, 2, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.VERTICAL,
                    new Insets(0, 0, 0, 5), 0, 0));
            }
            dialogPane.add(Basic, BorderLayout.NORTH);

            //======== buttonBar ========
            {
                buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
                buttonBar.setLayout(new GridBagLayout());
                ((GridBagLayout)buttonBar.getLayout()).columnWidths = new int[] {0, 85, 80};
                ((GridBagLayout)buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0};

                //---- okButton ----
                okButton.setText("OK");
                okButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        okButtonActionPerformed(e);
                    }
                });
                buttonBar.add(okButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 5), 0, 0));

                //---- cancelButton ----
                cancelButton.setText("Cancel");
                cancelButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cancelButtonActionPerformed(e);
                    }
                });
                buttonBar.add(cancelButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                    new Insets(0, 0, 0, 0), 0, 0));
            }
            dialogPane.add(buttonBar, BorderLayout.SOUTH);
        }
        contentPane.add(dialogPane, BorderLayout.CENTER);
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    private void getFieldToVariable(){



        //Assign to General Item info variables
        ni.ITEM_NO = sITEM_NO.getText();
        ni.PART_NO = sPART_NO.getText();
        ni.PARTLINK = sPARTSLINK.getText();
        ni.YR_L=sYR_L.getText();
        ni.YR_H=sYR_H.getText();
        ni.BRAND=sBRAND.getText();
        ni.MODEL   = sNEW_MOD.getText() + " " + ni.getYrto(ni.YR_L,ni.YR_H);
        ni.DESCRIPT= sNEW_DES.getText() + " " + sNEW_MOD.getText() + " " + ni.getYrto(ni.YR_L,ni.YR_H)  ;

        ni.m_key   = sNEW_MOD.getText(); //+ " " + ni.getYrto(ni.YR_L,ni.YR_H);  //same as ni.Model above
        ni.mod_one = sNEW_MOD.getText();
//        ni.FOB = sFOB.getText();          //NOT REQUIRED TO CREATE ITEM
//        ni.CIF = sCIF.getText();          //NOT REQUIRED TO CREATE ITEM
        ni.WH_SALE = sWH_SALE.getText();
        ni.RETAIL = sRETAIL.getText();
        ni.NEW_MOD = sNEW_MOD.getText();
        ni.NEW_DES = sNEW_DES.getText();
        ni.POSITION = sPOSITION.getText();
        ni.CATALOG = sCATELOG.getText();
        ni.REMARK = sREMARK.getText();
        ni.CAPA=sCAPA.getText();

        //Assign to Vendors variables
        ni.TYG_TW_NO=sTYG_TW_NO.getText();
        ni.TYG_TW_PRC=sTYG_TW_PRC.getText();
        ni.TYG_TW_PKG=sTYG_TW_PKG.getText();
        ni.TYG_TW_CUFT=sTYG_TW_CUFT.getText();
        ni.TYG_TW_REMARK=sTYG_TW_REMARK.getText();

        ni.TYG_TX_NO=sTYG_TX_NO.getText();
        ni.TYG_TX_PRC=sTYG_TX_PRC.getText();
        ni.TYG_TX_PKG=sTYG_TX_PKG.getText();
        ni.TYG_TW_CUFT=sTYG_TW_CUFT.getText();
        ni.TYG_TX_REMARK=sTYG_TX_REMARK.getText();

        ni.GN_NO=sGN_NO.getText();
        ni.GN_PRC=sGN_PRC.getText();
        ni.GN_PKG=sGN_PKG.getText();
        ni.GN_CUFT=sGN_CUFT.getText();
        ni.GN_REMARK=sGN_REMARK.getText();

        ni.DEPO_NO=sDEPO_NO.getText();
        ni.DEPO_PRC=sDEPO_PRC.getText();
        ni.DEPO_PKG=sDEPO_PKG.getText();
        ni.DEPO_CUFT=sDEPO_CUFT.getText();
        ni.DEPO_REMARK=sDEPO_REMARK.getText();

        ni.GD_NO=sGD_NO.getText();
        ni.GD_PRC=sGD_PRC.getText();
        ni.GD_PKG=sGD_PKG.getText();
        ni.GD_CUFT=sGD_CUFT.getText();
        ni.GD_REMARK=sGD_REMARK.getText();

        ni.PROTEC_NO=sPROTEC_NO.getText();
        ni.PROTEC_PRC=sPROTEC_PRC.getText();
        ni.PROTEC_PKG=sPROTEC_PKG.getText();
        ni.PROTEC_CUFT=sPROTEC_CUFT.getText();
        ni.PROTEC_REMARK=sPROTEC_REMARK.getText();

        ni.KV_NO=sKV_NO.getText();
        ni.KV_PRC=sKV_PRC.getText();
        ni.KV_PKG=sKV_PKG.getText();
        ni.KV_CUFT=sKV_CUFT.getText();
        ni.KV_REMARK=sKV_REMARK.getText();








    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner Evaluation license - jason Chi
    private JPanel dialogPane;
    private JPanel Vendor;
    private JLabel label24;
    private JLabel label25;
    private JLabel label26;
    private JLabel label27;
    private JLabel label28;
    private JLabel label29;
    private JLabel tygtw;
    private JTextField sTYG_TW_NO;
    private JTextField sTYG_TW_PRC;
    private JTextField sTYG_TW_PKG;
    private JTextField sTYG_TW_CUFT;
    private JTextField sTYG_TW_REMARK;
    private JLabel twgtx;
    private JTextField sTYG_TX_NO;
    private JTextField sTYG_TX_PRC;
    private JTextField sTYG_TX_PKG;
    private JTextField sTYG_TX_CUFT;
    private JTextField sTYG_TX_REMARK;
    private JLabel genera;
    private JTextField sGN_NO;
    private JTextField sGN_PRC;
    private JTextField sGN_PKG;
    private JTextField sGN_CUFT;
    private JTextField sGN_REMARK;
    private JLabel depo;
    private JTextField sDEPO_NO;
    private JTextField sDEPO_PRC;
    private JTextField sDEPO_PKG;
    private JTextField sDEPO_CUFT;
    private JTextField sDEPO_REMARK;
    private JLabel ap;
    private JTextField sGD_NO;
    private JTextField sGD_PRC;
    private JTextField sGD_PKG;
    private JTextField sGD_CUFT;
    private JTextField sGD_REMARK;
    private JLabel ycc;
    private JTextField sPROTEC_NO;
    private JTextField sPROTEC_PRC;
    private JTextField sPROTEC_PKG;
    private JTextField sPROTEC_CUFT;
    private JTextField sPROTEC_REMARK;
    private JLabel koolview;
    private JTextField sKV_NO;
    private JTextField sKV_PRC;
    private JTextField sKV_PKG;
    private JTextField sKV_CUFT;
    private JTextField sKV_REMARK;
    private JPanel Basic;
    private JLabel label1;
    private JTextField sITEM_NO;
    private JLabel label8;
    private JTextField sPART_NO;
    private JLabel label14;
    private JTextField sPARTSLINK;
    private JLabel label6;
    private JTextField sYR_L;
    private JLabel label7;
    private JTextField sYR_H;
    private JLabel label9;
    private JTextField sBRAND;
    private JLabel label10;
    private JTextField sNEW_MOD;
    private JLabel label11;
    private JTextField sNEW_DES;
    private JLabel label15;
    private JTextField sPOSITION;
    private JLabel label2;
    private JTextField sCATELOG;
    private JLabel label12;
    private JTextField sWH_SALE;
    private JLabel label13;
    private JTextField sRETAIL;
    private JLabel label16;
    private JTextField sCAPA;
    private JLabel label3;
    private JTextField sREMARK;
    private JCheckBox sSERIALIZED;
    private JCheckBox sDISCONTINUED;
    private JCheckBox sTAXABLE;
    private JCheckBox sINTERNETITEM;
    private JLabel label4;
    private JTextField sMODEL;
    private JLabel label5;
    private JTextField sDESCRIPT;
    private JLabel label17;
    private JPanel buttonBar;
    private JButton okButton;
    private JButton cancelButton;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
